﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using DnD.ViewModels;
using System.Diagnostics;

namespace DnD
{
    public partial class MapPage : PhoneApplicationPage
    {
        public MapPage()
        {
            try
            {

                InitializeComponent();

            }
            catch (Exception e)
            {
                Debug.WriteLine(e.ToString());
            }

            DataContext = new MapViewModel(this);
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            ((MapViewModel)DataContext).GPSMap = mapGps;
        }

        public void AppBar_Click(object sender, EventArgs e)
        {
            ((MapViewModel)DataContext).handleMenuRequest(((ApplicationBarIconButton)sender).Text);
        }
    }
}